//
//  UILabel+YQUILabel.m
//  WeiboOC
//
//  Created by yang on 15/11/15.
//  Copyright © 2015年 yang. All rights reserved.
//

#import "UILabel+YQUILabel.h"

@implementation UILabel (YQUILabel)
- (UILabel *)initWithTitle:(NSString *)title size:(CGFloat)size color:(UIColor *)color margin:(CGFloat)margin{
    UILabel *l = [[UILabel alloc]init];
    l.text = title;
    l.textColor = color;
    l.font = [UIFont systemFontOfSize:size];
    l.textAlignment = NSTextAlignmentCenter;
    l.numberOfLines = 0;
    if (margin != 0) {
        l.preferredMaxLayoutWidth = screenW - 2 * margin;
        l.textAlignment = NSTextAlignmentLeft;
    }
    [l sizeToFit];
    return l;
}
@end
